package sw6.app3;

import java.util.ArrayList;

import sw6.lib.internal.debug.*;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * Tests install of sw6.app3v1
 * @author sw6b
 */
public class TestActivity extends Activity {
	
	private static final String APP_NAME 	= "sw6.app3v1";
	private int testNumber 					= 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		//Define the resulting intent
		Intent resultIntent 		= new Intent();
		ArrayList<Boolean> results 	= new ArrayList<Boolean>();
		
		// TEST NO. 0
		try {
			int value 		= 1337;
			int expected 	= 1337;
			if(value == expected) {
				results.add(true);
			} else {
				throw new Exception("Something really bad went rong...");
			}
		} catch(Exception e) {
			DebugHelpers.logIssue(testNumber, APP_NAME, e.getMessage());
			results.add(false);
		}
		
		resultIntent.putExtra("appName", this.getString(R.string.app_name));
		resultIntent.putExtra("results", DebugHelpers.getBooleanArray(results));
		setResult(RESULT_OK, resultIntent);
		finish();
	}
}
